package gregorytersoff;
import gregorytersoff_boundary.DecisionlinesGUI;
import gregorytersoff_controller.ChoiceController;
import gregorytersoff_model.Model;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;







public class Main 
{
	
	public static void main(String[] args)
	{
		boolean rightnumbers = false;
		String m = "";
		String n = "";
		int i = 0;
		int j = 0;
		while(rightnumbers == false)
		{
			System.out.println("Input M rounds (between 3-8)");
			try
			{
				BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
				String M = bufferRead.readLine();
				m = M;
			}
			catch (IOException e) {
				e.printStackTrace();
			}
			System.out.println("Input N lines (between 3-8)");
			try
			{
				BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
				String N = bufferRead.readLine();
				n = N;
			}
			catch (IOException e) {
				e.printStackTrace();
			}
			
			try
			{
				i = Integer.parseInt(m.trim());
				j = Integer.parseInt(n.trim());
			}
			catch (NumberFormatException nfe)
			{
				System.out.println("NumberFormatException: " + nfe.getMessage());
			}
			if (i >= 3 && i <=8 && j >= 3 && j <=8)
			{
				rightnumbers = true;
			}
			else
			{
				System.out.println("Make sure the numbers are between 3 and 8");
			}
		}
		Model model = new Model(j, i);
		DecisionlinesGUI mg = new DecisionlinesGUI(model);
		
		
		
		mg.setVisible(true);
	}

}
